/*
 * Copyright (C) 2010-2012 Susanta Tewari
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package sampledata.coalescent.data;

import cef.pui.pob.Builder;
import cef.pui.pob.BuilderException;

import coalescent.cef.pui.pob.Builders;
import coalescent.data.K69Data.StringK69Data;

import commons.nb.data.DNData;

import java.util.Properties;

/**
 * @since since
 * @version version
 * @author Susanta Tewari
 * @history Created on Nov 9, 2012.
 */
public class K69DataDNDataFileBased extends DNData<StringK69Data> {

    /** Field description */
    private Builder<StringK69Data> builder;

    /**
     * Initializes description properties and creates the builder. A builder is created ({@link
     * Builders#getK69DataBuilderFileBased(java.util.Properties)}) based on the supplied file
     * URL.
     *
     * @param displayName display name
     * @param shortDescription short description
     * @param URL file URL; <a href="genomemap/cef/pui/pob/doc-files/k69-data.xml.txt">file </a>,
     * must accompany the <a href="genomemap/cef/pui/pob/doc-files/K69Data.xsd.txt">schema</a>
     */
    public K69DataDNDataFileBased(String displayName, String shortDescription, String URL) {

        super("K69Data", displayName, shortDescription);


        // <editor-fold defaultstate="coallapsed" desc="Builder">
        Properties props = new Properties();

        props.setProperty("coalescent.builder.StringK69Data.url", "stringk69data:xml//" + URL);

        builder = Builders.getStringK69DataBuilderFileBased(props);


        // </editor-fold>
    }

    /**
     * Method description
     *
     *
     * @return
     *
     * @throws BuilderException
     */
    @Override
    public Builder<StringK69Data> getBuilder() throws BuilderException {
        return builder;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    @Override
    public Class<StringK69Data> getBuilderValueType() {
        return StringK69Data.class;
    }
}
